//
//  topCell.m
//  项目一
//
//  Created by nick on 15/7/22.
//  Copyright (c) 2015年 nick. All rights reserved.
//

#import "topCell.h"
#import "UIImageView+WebCache.h"
#import "stars.h"
@implementation topCell
//@property (weak, nonatomic) IBOutlet UIImageView *cellImageView;
//@property (weak, nonatomic) IBOutlet UIView *starsView;
//@property (weak, nonatomic) IBOutlet UILabel *score;
- (void)awakeFromNib {
    // Initialization code
}
- (void)setModal:(movieRank *)modal{
    _modal = modal;
    [self setNeedsLayout];
}
- (void)layoutSubviews{
    NSDictionary *images = _modal.images;
    [self.cellImageView sd_setImageWithURL:[NSURL URLWithString:[images objectForKey:@"medium"]]];
    self.score.text = [NSString stringWithFormat:@"%.1f",_modal.average];
    CGRect frame = self.starsView.frame;
    
    stars *s = [[stars alloc]initWithFrame:CGRectMake(0, 0,frame.size.width, frame.size.height)];
    s.average = _modal.average;
    [self.starsView addSubview:s];
}
@end
